package com.suggestion.dao;

import java.util.List;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import com.suggestion.bean.OfSuggestion;
import com.suggestion.bean.Suggestion;

public class SuggestionDAOImpl extends SqlMapClientDaoSupport implements ISuggestionDAO {
	
	public boolean AddSuggestion(OfSuggestion ofSuggestion) {
		 getSqlMapClientTemplate().insert("_Suggestion.insertSuggestion",ofSuggestion);
		 return true;
	}

	@SuppressWarnings("unchecked")
	public List<Suggestion> getAllSuggestion() {
		
		return (List<Suggestion>)getSqlMapClientTemplate().queryForList("user_suggestionmsy.getUserSuggestion");
	}

	public int deleteSuggestion(long ofId) {
		return getSqlMapClientTemplate().delete("_Suggestion.deleteSuggestion", ofId);
	}

	@SuppressWarnings("unchecked")
	public List<OfSuggestion> getAllSuggestionLimit() {
		return (List<OfSuggestion>)getSqlMapClientTemplate().queryForList("_Suggestion.getAllSuggestionLimit");
	}

}
